from core.cloners_module.base_cloner import BaseProjectCloner


class GenericProjectCloner(BaseProjectCloner):
    """通用项目克隆器"""

    def clone(
        self,
        source_path: str,
        target_path: str,
        modify_fingerprints: bool,
    ) -> str:
        """
        克隆通用项目
        :param source_path: 源项目路径
        :param target_path: 目标项目路径
        :param modify_fingerprints: 是否修改文件指纹
        :return: 目标项目路径
        """
        self.logger.log_operation("克隆通用项目", "开始复制文件")

        self._copy_project_files(source_path, target_path, "generic")
        self._modify_fingerprints_if_needed(target_path, "generic", modify_fingerprints)

        self.logger.log_operation("项目克隆完成", target_path)
        return target_path
